import http from '/@/utils/http';

export const getTree = async () => {
  return await http.get('/user/mobile/sysDeptInfo/deptTreeList')
}

export const postAddDept = async (params: any) => {
  return await http.post('/user/mobile/sysDeptInfo/addDept', params)
}

export const editDept = async (params: any) => {
  return await http.put('/user/mobile/sysDeptInfo/editDept', params)
}

export const deleteDept = async (params: any) => {
  return await http.delete('/user/mobile/sysDeptInfo/deleteDept', params)
}

export const getRoleList = async () => {
  return await http.get('/user/mobile/sysRoleInfo/getRoleList')
}

export const putEnableState = async (params: any) => {
  return await http.putUrlForm('/user/mobile/userInfo/setEnableState', params)
}

export const putResetPwd = async (params: any) => {
  return await http.putUrlForm('/user/mobile/userInfo/resetPwd', params)
}

export const deleteUser = async (params: any) => {
  return await http.delete('/user/mobile/userInfo/deleteUser', params)
}

export const putEditUser = async (params: any) => {
  return await http.put('/user/mobile/userInfo/editUser', params)
}

export const postAddUser = async (params: any) => {
  return await http.post('/user/mobile/userInfo/addUser', params)
}

export const postAny = async (params: any) => {
  return await http.post('/system/mobile/sysDataDictionary/dictionaryList', params)
}

export const downloadMould = async () => {
  return await http.getDown('/user/mobile/userInfo/downloadMould')
}

export const importUser = async (params: any) => {
  return await http.postUpload('/user/mobile/userInfo/importUser', params)
}

export const deviceTypeListApi = async (params: any) => {
  return await http.post('/system/mobile/sysDataDictionary/deviceTypeList', params)
}

export const updateUserAccountApi = async (params: any) => {
  return await http.put('/user/mobile/userInfo/updateUserAccount', params)
}

export const deptUserTreeListApi = async () => {
  return await http.get('/user/mobile/sysDeptInfo/deptUserTreeList')
}

export const transferAdministratorApi = async (fromUserId: any, toUserId: any) => {
  return await http.put(`/user/mobile/userInfo/transferAdministrator/${fromUserId}/${toUserId}`)
}
